package com.kin207.netty.handle.impl;

import com.kin207.netty.context.RequestContext;
import com.kin207.netty.handle.IMessageHandle;
import com.kin207.netty.msg.vo.SystemMessageReqVo;
import com.kin207.netty.msg.vo.SystemMessageVo;
import com.kin207.netty.session.SessionManagerAbs;

public class SystemMessageHandle implements IMessageHandle<SystemMessageReqVo> {

	public String name() {
		return "/msg/sys";
	}

	public Class paramClass() {
		return SystemMessageReqVo.class;
	}

	public void handle(SystemMessageReqVo param) {
		RequestContext req = RequestContext.curr.get();
		SessionManagerAbs sessionManger = req.getSessionManager();
		
		sessionManger.sendSystemMessage(new SystemMessageVo(param.getMessage()).toString(),System.currentTimeMillis());
	}

}
